<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template iterator</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../boost_typeerasure/reference.html#doxygen.iterator_8hpp" title="Header &lt;boost/type_erasure/iterator.hpp&gt;">
<link rel="prev" href="structboost_1_1type__erasure_1_1forward__iterator.html" title="Struct template forward_iterator">
<link rel="next" href="structboost_1_1type__erasure_1_1random__access__iterator.html" title="Struct template random_access_iterator">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1type__erasure_1_1forward__iterator.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_typeerasure/reference.html#doxygen.iterator_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1type__erasure_1_1random__access__iterator.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.structboost_1_1type__erasure_1_1iterator"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template iterator</span></h2>
<p>boost::type_erasure::iterator</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../move/reference.html#doxygen.iterator_8hpp" title="Header &lt;boost/move/iterator.hpp&gt;">boost/type_erasure/iterator.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Traversal<span class="special">,</span> <span class="keyword">typename</span> T <span class="special">=</span> <span class="identifier">_self</span><span class="special">,</span> 
         <span class="keyword">typename</span> Reference <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">use_default</span><span class="special">,</span> 
         <span class="keyword">typename</span> DifferenceType <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span><span class="special">&gt;</span> 
<span class="keyword">struct</span> <a class="link" href="structboost_1_1type__erasure_1_1iterator.html" title="Struct template iterator">iterator</a> <span class="special">{</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>    <a name="doxygen.structboost_1_1type__erasure_1_1iterator_1a540ef98bf7a3e907023888c1acef431c"></a><span class="identifier">value_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">Reference</span>      <a name="doxygen.structboost_1_1type__erasure_1_1iterator_1aceba263da02a800dc7782e9aefe3969e"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">DifferenceType</span> <a name="doxygen.structboost_1_1type__erasure_1_1iterator_1ae13ebb800ce7e5f016b0765d515f6d0e"></a><span class="identifier">difference_type</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.39.13.23.5.4"></a><h2>Description</h2>
<p>The <a class="link" href="structboost_1_1type__erasure_1_1iterator.html" title="Struct template iterator">iterator</a> concept can be used for any iterator category.</p>
<p>
The value_type of the iterator is deduced. To force it to be a specific type, use the <a class="link" href="structboost_1_1type__erasure_1_1same__type.html" title="Struct template same_type">same_type</a> concept.</p>
<p>Example:</p>
<pre class="programlisting"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span>
  <span class="identifier">iterator</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward_traversal_tag</span><span class="special">&gt;</span><span class="special">,</span>
  <span class="identifier">same_type</span><span class="special">&lt;</span><span class="identifier">iterator</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward_traversal_tag</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">value_type</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">int_it</span><span class="special">;</span>
</pre>
<p> </p>
<div class="refsect2">
<a name="id-1.3.39.13.23.5.4.6"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Traversal</pre>
<p>must be one of <code class="computeroutput">boost::incrementable_traversal_tag</code>, <code class="computeroutput">boost::single_pass_traversal_tag</code>, <code class="computeroutput">boost::forward_traversal_tag</code>, <code class="computeroutput">boost::bidirectional_traversal_tag</code>, and <code class="computeroutput">boost::random_access_traversal_tag</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> T <span class="special">=</span> <span class="identifier">_self</span></pre>
<p>The placeholder representing the iterator. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Reference <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">use_default</span></pre>
<p>The reference type. If it is boost::use_default, then reference will be value_type&amp;. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> DifferenceType <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span></pre>
<p>The iterator's difference type.</p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2011-2013 Steven Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1type__erasure_1_1forward__iterator.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_typeerasure/reference.html#doxygen.iterator_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1type__erasure_1_1random__access__iterator.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
